/**
* projectOperationChart functions
* copyright@Catosoft.com reserved, 2016
* 2016.07.30, created by Eric.Wang
*/


/*
* get data
*/
var getedcProjectOperationData = function(){
	var data = {

	};
	var option = {
		url: '/draft/project/operation/info/v1',
		type: 'GET',
		data: data,
	};
	createAjax(option, function(err, res){
		if(!err){
			projectOperationTable('projectOperationTable', res);
		}
	});
}

/*
* draw charts
*/
var projectOperationTable = function(element, data){
	$('#' + element).bootstrapTable({
		data: data.list,
		classes: 'table table-hover',
		pagination: true,
		pageSize: 20,
		pageNumber: 1,
		pageList: [20, 50],
		sidePagination: 'client',
		showRefresh: true,
		showColumns: true,
		buttonsAlign: 'right',
		showExport: true,
		exportDataType: 'all',
		exportTypes: ['csv', 'txt', 'excel'],
		locale: 'zh-CN',
		columns: [
		{
			field: 'Number',  
	    title: '序号',  
	    formatter: function (value, row, index) {  
	    	return index + 1;  
	    }
		},
		{
			title: '中心',
			field: 'pursuercodes',
		}, {
			title: '操作类型',
			field: 'operate_type',
		}, {
			title: '受试者',
			field: 'person_name',
		}, {
			title: '访视期',
			field: 'period_name',
		}, {
			title: '表单',
			field: 'table_name',
		}, {
			title: '操作日期',
			field: 'operate_date',
		}, {
			title: '操作人',
			field: 'operator_name',
		}],

	});
}

$(function(){
	getedcProjectOperationData();
});